<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8" />
	<title>晒图</title>
	<meta name="author" content="Liang wei">
    <meta name="viewport" content="width= device-width , user-scalable=no,initial-scale=1.0" />
	<link rel="stylesheet" href="css/header.css" />
	<link rel="stylesheet" href="css/lunbo.css" />
	<link rel="stylesheet"  href="css/base.css"/>
	<link rel="stylesheet" href="css/index.css" />
	<script type="text/javascript" src="js/lunbo.js" ></script>
	<script type="text/javascript" src="js/jquery-3.1.1.js" ></script>
	<script type="text/javascript" src="js/vue.js" ></script>
	<link rel="stylesheet" href="css/footer.css" />
	
	<style>
		.update{
			/*border: 1px solid red;*/
			height: 150px;
			margin-top: 20px;
		}
		#from{
			/*border: 1px solid blue;*/
			margin-top: 30px;
		}
	</style>
	</head>
	<body>
		<div>
			
		<div>
		<header>
				<img src="img/logo.png"  />
				<form class="search" action="">
					<input class="search_text" type="text" placeholder="搜索" />
				</form>
				
		</header>
    	
  
    	
        </div>
		 <div class="hm_banner">
            <ul class="clearfix">
                <li><a href="#"><img src="img/轮播1.jpg"  alt=""/></a></li>
                <li><a href="#"><img src="img/轮播2.jpg" alt=""/></a></li>
                <li><a href="#"><img src="img/轮播3.jpg" alt=""/></a></li>
                <li><a href="#"><img src="img/轮播1.jpg" alt=""/></a></li>
                <li><a href="#"><img src="img/轮播2.jpg" alt=""/></a></li>
                <li><a href="#"><img src="img/轮播3.jpg" alt=""/></a></li>
                <li><a href="#"><img src="img/轮播1.jpg" alt=""/></a></li>
                <li><a href="#"><img src="img/轮播2.jpg" alt=""/></a></li>
          		<li><a href="#"><img src="img/轮播2.jpg" alt=""/></a></li>
              
            </ul>
            <ul>
                <li class="now"></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </div>
        
        
        

        <div id="activity">
			  <p class="activity_title">晒图</p>
			  <ul class="activity-list">
				<li class="activity-list-item" v-for="item in List1">					
					<img :src="'http://172.24.10.175/workout/Uploads/'+item.thumb0" />
					 <div>{{item.update_time}}</div>								 						
				</li>					 			
			 </ul>			 
	    </div>
		
        	
      
     </div>
     
     <div class="update" >
			<form id="from">
				<input type="file" name="thumb0" id="update-img"/>
				<button >发布晒图</button>					
			</form>
	 </div>
			
     
     
     
         
	
	<!--尾栏-->
	<div class="footer_box">
	  <a href="train2.html"><img src="img/步数.png"/>训练</a>     
      <a href="club.html"><img src="img/运动.png"/>俱乐部</a>
      <a href="index.html"><img src="img/设备.png"/>约建</a>
      <a href="showpicture.html"><img src="img/活动.png"/>晒图</a>   
      <a href="wode.html"><img src="img/首页.png"/>我的</a>
    </div>
	
	
	
	</footer>
	
	
	<script type="text/javascript" src="js/common.js" ></script>
	
	<script>
		var activity=new Vue({
				el:"#activity",
				data:{
					 List1:[],				 
				 },
				mounted:function(){
					this.getData();
				},
				methods:{
					getData:function(){
					    $.ajax({
				           type:"get",
				           url:"http://172.24.10.175/workout/api.php/lists/mod/shaitu",
				           async:true,
				           dataType:"jsonp",
				           success:function(data){	      	   		          
	      	   		              for(var i=0;i<data.length;i++){
	      	   		              	activity.List1.push(data[i]);
	      	   		              }
	      	   	           }
			           });	
					}
				}
			});
		
		    
		    
		    
		    
		    
		    
		    
		    
		    
	</script>
	
   <script type="text/javascript">
   	  
   	   $(function () {  	      
	    	 var userid=window.localStorage.getItem("userid");
//	    	 console.log(userid);
	         $("#from button").click(function () {     	
	
	            var formData = new FormData($('#from')[0]);  
	            $.ajax({  
	                type: 'post',  
	                url: "http://172.24.10.175/workout/api.php/fcreate/mod/shaitu/userid/"+userid+"/title/hahahahaha/SessionID/fabvhredigmf59qcgmg1dipav3",  
	                data: formData,  
	                cache: false,  
	                processData: false,  
	                contentType: false,  
	           success :function (data){  
	            	console.log(data);
	                alert("上传成功");  
	            }
	           ,
	            error:function () {
	                alert("上传成功");  
	            }
	        });  
	    }); 	    
	   }); 
   	  
   	  
   </script>
	
	
	
	
	
	
	
	
	
	</body>
	

</html>
